package com.example.pertecttime.fragent.timeline;

import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.pertecttime.R;
import com.example.pertecttime.base.BaseFragment;
import com.example.pertecttime.base.Properties;
import com.example.pertecttime.entity.User;
import com.example.pertecttime.tools.MD5Utils;

/**
 * Created by 半生瓜 on 2017/7/20.
 */

public class TimelineFragment extends BaseFragment<TimelinePresent, TimelineModel> implements TimelineContract.View {
    Button b;
    TextView v;
    EditText E;
    private FragmentManager fragmentManager;

    @Override
    public int getLayoutId() {
        return R.layout.timeline_layout;
    }

    @Override
    public void initView() {
        b = (Button) getActivity().findViewById(R.id.frag_bt);
        v=(TextView)getActivity().findViewById(R.id.frag_tv);
        E=(EditText)getActivity().findViewById(R.id.frag_et);
    }

    @Override
    public void initclicklisten() {
        b.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i("地址",Properties.testURL);
//                presenter.dotest(new test("1","1","2","2"));
                presenter.dologin(new User("15759990191", MD5Utils.md5(E.getText().toString())));
            }
        });
    }


    @Override
    public void onresult(String a) {
        ts.show_l(a);
     v.setText(a);

    }


}
